const defaultState = {
	fixed: false,
	// 是否展示标题
	showTitle: false,
	// 搜索值
	searchValue: '',
	// 是否显示搜索栏目
	showSearch: false,
	// 搜索结果
	searchResult: []
}

export default (state = defaultState, action) => {
	switch(action.type) {
		case 'change_fixed': 
			return {
				...state,
				fixed: action.value
			}
		case 'change_showText': 
			return {
				...state,
				showTitle: action.value
			}
		case 'change_searchValue': 
			return {
				...state,
				searchValue: action.value
			}
		case 'change_showSearch': 
			return {
				...state,
				showSearch: action.value
			}
		case 'change_result':
			return {
				...state,
				searchResult: action.value
			}
		case 'reset_result':
			return {
				...state,
				searchValue: '',
				showSearch: false,
				searchResult: []
			}
		default: 
			return state
	}
}